import pandas as pd
from utils import df_into_db


path = "E:/data/amount_data/total_marketcap_and_amount.csv"
df = pd.read_csv(path)
null_df = df[df.isna().any(axis=1)]
check_by_date = df[df["end_date"].isin(set(null_df["end_date"]))]  # 检查发现空值的数据其实出现了两次
df = df[~df.isna().any(axis=1)]
df = df.drop_duplicates(subset=["end_date"], keep="first")
df_into_db(df, db_name="dataloader", table_name="total_marketcap_and_amount")
